{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑个人信息</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">姓名：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_real_name" lay-verify="required" class="layui-input" placeholder="姓名" value="{$user.ma_user_name}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">性别：</label>
                            <div class="layui-input-block">
                                <select name="user_gender" xm-select="select1" lay-verify="required" xm-select-radio=""  xm-select-search="" xm-select-search-type="dl">
                                    <option value="1" {$user.ma_user_gender == 1 ? 'selected' : ''}>男</option>
                                    <option value="2" {$user.ma_user_gender == 2 ? 'selected' : ''}>女</option>
                                </select>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">出生日期：</label>
                            <div class="layui-input-inline">
                                <input type="text"  name="user_birthday" lay-verify="required" placeholder="出生日期" class="layui-input test-item" value="{$user.ma_user_birthday}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">身份证号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_ID_number" lay-verify="required" class="layui-input" placeholder="身份证号" value="{$user.ma_user_ID_number}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">电话：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_call" lay-verify="required" class="layui-input" placeholder="电话" value="{$user.ma_user_call}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">邮箱：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_email" lay-verify="required" class="layui-input" placeholder="邮箱" value="{$user.ma_user_email}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">紧急联系人手机号：</label>
                            <div class="layui-input-block">
                                <input type="text" name="user_urg_phone" lay-verify="required" class="layui-input" placeholder="紧急联系人手机号" value="{$user.ma_user_urg_phone}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">世界帆联ID：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ma_user_fanlian_ID" class="layui-input" placeholder="紧急联系人手机号" value="{$user.ma_user_fanlian_ID}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">国家帆协ID：</label>
                            <div class="layui-input-block">
                                <input type="text" name="ma_user_fanxie_ID" class="layui-input" placeholder="紧急联系人手机号" value="{$user.ma_user_fanxie_ID}">
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">航海起航时间：</label>
                            <div class="layui-input-inline">
                                <input type="text"  name="user_sailing_time" placeholder="航海起航时间" class="layui-input test-item" value="{$user.ma_user_sailing_time}">
                            </div>
                        </div>

                        <input type="hidden" name="ma_id" value="{$ma_id}">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">保存
                                </button>
                                <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">关闭</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}

<script>
    wk.uploadImg({size:5,type:'png,jpg,jpeg',url:"{:url('Upload/upload')}",domain:""});
    layui.use(['form','upload','layedit','laydate'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $('.layui-btn').addClass('layui-disabled').attr('disabled','disabled');
            $.ajax({
                url:"{:url('otherEdit')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    if (res.code == 200) {
                        wk.success(res.msg,"{:url('Matchmember/memberOther')}")
                    } else {
                        wk.error(res.msg,'','$(".layui-btn").removeClass(\'layui-disabled\').removeAttr(\'disabled\');');
                    }
                }
            });

        });
        var laydate = layui.laydate;
        //同时绑定多个
        lay('.test-item').each(function(){
            laydate.render({
                elem: this
                ,format:'yyyy-MM-dd'
                ,type:'date'
                ,trigger: 'click'
            });
        });

    });
</script>

</body>
</html>
